Computer programs or applications may comprise several intercommunicating software modules, components, or processes executing on multiple computer systems. The modules may communicate with each other by sending messages to each other. Some applications employ the Java Messaging Service (JMS) for intercommunication among modules or processes.
JMS provides support for message-based communication between separate Java processes. This message-based communication is asynchronous. More specifically, a message addressed to a recipient or group is sent, and the recipient receives and acts on the message at some later time. Clients of the JMS send and receive messages through a provider that is responsible for delivering messages. In point-to-point JMS, a message is created by one client and addressed to a single remote recipient. The provider is handed the message and delivers it to the one recipient targeted by the message. This model revolves around message queues. A message sender queues outgoing messages for delivery, and a message recipient queues incoming messages for handling. In some cases a JMS server supports the queue, and the message recipient must read from the JMS server's queue. In some circumstances, in a test environment for example, messages may persist and may not be removed from the queue, the queue may become cluttered, and message operations may become inefficient.